﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Konstaller
{
   public  class Dialog
    {

       //private fields
       string cap = "Informazione";
       string bt = "< OK >";


       const char top_left = '\u2552';
       const char line = '\u2550';
       const char top_right = '\u2557';
       const char lineH = '\u2551';
       const char b_left = '\u255A';
       const char b_right = '\u255B';


       /// <summary>
       /// GET or Set Caption
       /// </summary>
       public string Caption
       {
           get { return cap; }
           set { cap = value; }

       }


   

       /// <summary>
       /// Get or Set Button Text
       /// </summary>
       public string Button
       {
           get { return bt; }
           set { bt = value; }
       }


       /// <summary>
       /// Show Method
       /// </summary>
       /// <param name="Text">Content</param>
       public void Show(string Text)
       {
           //Configurazioni
           int w = Console.WindowWidth;
           int h = Console.WindowHeight;

           Console.BackgroundColor = ConsoleColor.Gray;
           Console.ForegroundColor = ConsoleColor.Black;


           int tot1 = w / 3;
           int tot2 = h / 3;

           Console.SetCursorPosition(tot1, tot2);
           
           //Disegno Barra Titolo

           Console.Write(top_left);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           for (int i = 0; i < Text.Length; i++)
           {
               
               Console.Write(line);
               
           }
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(top_right);



           //  Parte Centrale

           #region 1

           Console.SetCursorPosition(tot1, tot2 + 1);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(" ");

           }

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #endregion

           #region 2

           Console.SetCursorPosition(tot1, tot2 + 2);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(" ");

           }

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #endregion

           #region 3

           Console.SetCursorPosition(tot1, tot2 + 3);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(" ");

           }

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #endregion


           Console.SetCursorPosition(tot1, tot2 + 4);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

  
           Console.Write(Text);
           

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #region 4

           Console.SetCursorPosition(tot1, tot2 + 5);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(" ");

           }

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #endregion

           #region 5

           Console.SetCursorPosition(tot1, tot2 + 6);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(" ");

           }

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #endregion

           #region 6

           Console.SetCursorPosition(tot1, tot2 + 7);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(" ");

           }

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #endregion

           #region 7

           Console.SetCursorPosition(tot1, tot2 + 8);
           Console.Write(lineH);
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(" ");

           }

           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(" ");
           Console.Write(lineH);

           #endregion

         

           Console.SetCursorPosition(tot1, tot2 + 9);
           Console.Write(b_left);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);

           for (int i = 0; i < Text.Length; i++)
           {

               Console.Write(line);

           }

           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(line);
           Console.Write(b_right);

       }
    }
}
